package com.sky.controller.user;

import com.sky.dto.UserLoginDTO;
import com.sky.result.Result;
import com.sky.service.UserService;
import com.sky.vo.UserLoginVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * ClassName: UserController
 * Package: com.sky.controller.user
 * Description:用户端的用户接口
 *
 * @Author: Zhang Peiyuan
 * @Create: 2024-12-21-12:53
 * @Version: v1.0
 */
@RestController
@RequestMapping("/user/user")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/login")
    public Result<UserLoginVO> login(@RequestBody UserLoginDTO userLoginDTO) {
        // userLoginDTO中存储的是微信用户授权码
        // 返回信息 用户id 用户openid jwt令牌
        return Result.success(userService.login(userLoginDTO));
    }
}
